import {http} from "@/utils";
import {ResType} from "@/apis/ResType";

// 请求文章详情
// 定义具体的接口类型
export type DetailRes = {
    art_id: string
    title: string
    pubdate: string
    content: string
    aut_name: string
    aut_photo: string
    is_followed: boolean
    is_collection: boolean
    attitude: number
    comm_count: number
    read_count: number
    like_count: number
}

// 文章详情发送请求
export function fetchDetailApi(id: string) {
    return http.request<ResType<DetailRes>>({
        url: `/articles/${id}`
    })
}